<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>保险申请</title>
<link rel="stylesheet" type="text/css" href="../../css/mokstyle.css" />
<style>
		a:link {text-decoration: none;}
		a:visited {text-decoration: none;}
		a:active {text-decoration: none;}
		a:hover {text-decoration:underline;padding-bottom:8px;border-bottom:1 solid black}
		</style> 
		<script type="text/javascript">
			function change(id){
				if(id=='history'){
					window.location = "/aasimp/mok/insurance/insur_showall"
				}else{
					document.getElementById('a2').style.textDecoration = 'underline';
					document.getElementById('a1').style.textDecoration = 'none';
					document.getElementById(id).style.display = 'block';
					document.getElementById('history').style.display = 'none';
					var d = new Date();
					var year = d.getFullYear();
					var month = d.getMonth() + 1;
					if((month/10)<1){
						month = "0"+month; 
					}
					var date = d.getDate();
					if((date/10)<1){
						date = "0"+date; 
					}
					var hour = d.getHours() ;
					if((hour/10)<1){
						hour = "0"+hour; 
					}
					var minutes = d.getMinutes() ;
					if((minutes/10)<1){
						minutes = "0"+minutes; 
					}
					var seconds = d.getSeconds() ;
					if((seconds/10)<1){
						seconds = "0"+seconds; 
					}
					document.getElementById('id_Insurance').value = year+month+date+hour+minutes+seconds;
				}
			}
			function deleteone(idInsurance,type){
				if(type==2){
					alert("申请成功的保险，不能删除！");
					return;
				}
    			var a = window.confirm("确认删除？");
    			if(!a)return;
    			window.location="/aasimp/mok/insurance/insur_deleteTc?idInsurance="+idInsurance;
    		}
    		function showone(idInsurance){
    			window.location="/aasimp/mok/insurance/insur_showonebedding?idInsurance="+idInsurance;
    				document.getElementById('a2').style.textDecoration = 'underline';
					document.getElementById('a1').style.textDecoration = 'none';
					document.getElementById('new').style.display = 'block';
					document.getElementById('history').style.display = 'none';
    		}
    		function choosecompany() {
		        var returnValue = window.showModalDialog("/aasimp/mok/insurance/insur_getCompanys", null, "dialogHeight:400px; dialogWidth:600px; help:no; status:no");
		        if (returnValue==null){
		         	return;
		        } 
		        document.getElementById("id_company").value = returnValue;
    		}
    		function choosetype() {
    			var idcom = document.getElementById("id_company").value; 
		        var returnValue = window.showModalDialog("/aasimp/mok/insurance/insur_showmodelByCom?idcompany="+idcom, null, "dialogHeight:400px; dialogWidth:600px; help:no; status:no");
		        if (returnValue==null){
		         	return;
		        } 
		        document.getElementById("idType").value = returnValue;
    		}
			function init(){
    			if("${message}"!=""){
					alert("${message}");
				}
    		}
		</script>

</head>
<body onload="init();">
<div id="wrap">

       <div class="header">
       		<div class="logo"><a href="/aasimp/mok/insurance/insur_index"><img src="../../images/logo.gif" alt="" title="" border="0" /></a></div>            
        <div id="menu">
            <ul> 
            <li><a href="/aasimp/mok/insurance/insur_index">首页</a></li>
            <li><a href="personInfo.jsp">个人保险信息</a></li>
            <li><a href="/aasimp/mok/insurance/insur_showAllLp">车辆理赔信息</a></li>
            <li><a href="/aasimp/mok/insurance/insur_showAllLpCom">车辆理赔审核</a></li>
            <li class="selected"><a href="/aasimp/mok/insurance/insur_showall">车辆保险套餐</a></li>
            <li><a href="/aasimp/mok/insurance/insur_showallCom">车辆保险受理</a></li>
            <li><a href="/aasimp/mok/insurance/insur_showBb">报表统计</a></li>
            </ul>
        </div>     
            
            
       </div> 
       
       
       <div class="center_content">
       	<div class="left_content" style="width: 880px">
       		<div class="crumb_nav">
            <a href="/aasimp/mok/insurance/insur_index">home</a> &gt;&gt; 车辆保险套餐
            </div>
            <div class="title"><span class="title_icon"><img src="../../images/bullet1.gif" alt="" title="" /></span>
            <a id="a1" href="javascript:void(0)" onclick="change('history')" style="text-decoration: underline">我的车辆保险记录</a>
            <a id="a2" href="javascript:void(0)"  onclick="change('main')" style="text-decoration:none">新增保险</a>
            </div>
        <center>
        	<div class="feat_prod_box_details" id="history" style="display: block;">
            <p class="details">
            </p>
                    <table width="100%"  border="1" align="center" cellspacing="1">
                    	<tr>
                    		<th>保险单编号</th>
                    		<th>险种编号</th>
                    		<th>创建时间</th>
                    		<th>保险费总价</th>
                    		<th>车辆编号</th>
                    		<th>保险开始时间</th>
                    		<th>保险结束时间</th>
                    		<th>保险公司编号</th>
                    		<th>状态</th>
                    		<th>操作员</th>
                    		<th>操作</th>
                    	</tr>
                    		<c:forEach var="insurance" items="${allinsurance}">
						  <tr onDblClick="showRow('${insurance.id }')">
						    <td align="center">${insurance.idInsurance }</td>
						    <td align="center">${insurance.idType }</td>
						    <td align="center">${insurance.createtime }</td>
						    <td align="center">${insurance.price }</td>
						    <td align="center">${insurance.idCar }</td>
						    <td align="center">${insurance.timebegin }</td>
						    <td align="center">${insurance.timeend }</td>
						    <td align="center">${insurance.idCompany }</td>
						     <td align="center">
						    <c:if test="${insurance.type =='1'}">新</c:if>
						    <c:if test="${insurance.type =='2'}">申请通过</c:if>
						    <c:if test="${insurance.type =='3'}">申请未通过</c:if>
						    </td>
						    <td align="center">${insurance.userid }</td>
                    		<td>
                    		<a href="javascript:void(0)" onclick="deleteone('${insurance.idInsurance}','${insurance.type}')">删除</a></td>
						  </tr>
					 	 </c:forEach>
                    </table>
                    <div class="pageNo" id="pageNo">
					<a href="/aasimp/mok/insurance/insur_queryTc?no=1">首页</a>
					<c:if test="${sessionScope.pageNoBuy != 1}">
						<a href="/aasimp/mok/insurance/insur_queryTc?no=${sessionScope.pageNoBuy-1}">上一页</a>
					</c:if>
					<c:forEach var="i" begin="${sessionScope.pageNoCenterBuy -2}"
						end="${sessionScope.pageNoCenterBuy + 2}">
						<c:if test="${i <= sessionScope.totalNoBuy }">
							<c:choose>
								<c:when test="${i == sessionScope.pageNoBuy}">
									<a href="javascript:void(0)">${i}</a>
								</c:when>
								<c:otherwise>
									<a href="/aasimp/mok/insurance/insur_queryTc?no=${i}">${i}</a>
								</c:otherwise>
							</c:choose>
						</c:if>
					</c:forEach>
					<c:if test="${sessionScope.pageNoBuy < sessionScope.totalNoBuy}">
						<a href="/aasimp/mok/insurance/insur_queryTc?no=${sessionScope.pageNoBuy+1}">下一页</a>
					</c:if>
					<a href="/aasimp/mok/insurance/insur_queryTc?no=${sessionScope.totalNoBuy}">末页</a>
					&nbsp;&nbsp;&nbsp;&nbsp;共有
					<label style="color: red;">
						${sessionScope.totalBuy}
					</label>
					条信息
				</div>
            </div>

						<div class="feat_prod_box_details" id="main" style="display: none;">
							<p class="details">
							</p>
							<form name="register" action="/aasimp/mok/insurance/insur_addTc"  method="post">          
			                   
			                    <div class="form_row" style="width: 345px">
			                    <label class="contact" style="width: 78px"><strong>保险单编号：</strong></label>
			                    <input type="text" name="idInsurance" id="id_Insurance" class="contact_input" readonly="readonly"/>
			                    </div> 
			
								<div class="form_row" style="width: 345px">
			                    <label class="contact" style="width: 78px"><strong>保险公司编号：</strong></label>
			                    <input type="text" name="idCompany" id="id_company"  size="20" maxlength="10"  readonly="readonly"/>
			                     <a href="javascript:void(0)" onclick="choosecompany();return false;">
                  				  <image src='images/selectDate.gif' width="15" height="12" border="0" alt=""></a>
			                    </div>
			                    
			                    
			                    <div class="form_row" style="width: 345px">
			                    <label class="contact" style="width: 78px"><strong>险种编号：</strong></label>
			                    <input type="text" id="idType" name="idType"  size="20" maxlength="10"  readonly="readonly"/>
			                    <a href="javascript:void(0)" onclick="choosetype();return false;">
                  				  <image src='images/selectDate.gif' width="15" height="12" border="0" alt=""></a>
			                    </div> 
			
			                    <div class="form_row" style="height: 14px;width: 345px">
			                    <label class="contact" style="width: 78px"><strong>保险费总价：</strong></label>
			                    <input type="text" name="price" class="contact_input"/>
			                    </div>
			
			                    <div class="form_row" style="width: 345px">
			                    <label class="contact" style="width: 78px"><strong>车辆编号：</strong></label>
			                    <input type="text" name="idCar" class="contact_input" />
			                    </div>
			                    

			
			                    <div class="form_row" style="width: 345px">
			                    <label class="contact" style="width: 78px"><strong>保险开始时间：</strong></label>
			                    <input name="timebegin"  id="timebegin" type="text" size="20" maxlength="10"  readonly="readonly" />
						          <a href="javascript:void(0)" onclick="gfPop.fPopCalendar(document.register.timebegin);return false;" hidefocus="hidefocus">
						          <img name="popcal" align="absmiddle" src="<%=path %>/calendar/calbtn.gif" width="34" height="22" border="0" alt="发帖日期晚于" /></a>
			                    </div>
			
								<div class="form_row" style="width: 345px">
			                    <label class="contact" style="width: 78px"><strong>保险结束时间：</strong></label>
			                    <input name="timeend"  id="timeend" type="text" size="20" maxlength="10"   readonly="readonly"/>
						          <a href="javascript:void(0)" onclick="gfPop.fPopCalendar(document.register.timeend);return false;" hidefocus="hidefocus">
						          <img name="popcal" align="absmiddle" src="<%=path %>/calendar/calbtn.gif" width="34" height="22" border="0" alt="发帖日期晚于" /></a>
			                   
			                    </div>
			                    
			                    <div class="form_row" style="width: 345px">
			                    <input type="submit" class="register" value="申报保险" />
			                    </div>   
			                  </form>
						</div>
						
					</center>
            
            
        <div class="clear"></div>
        </div><!--end of left content-->
        
       
       <div class="clear"></div>
       </div><!--end of center content-->
       
              
       <div class="footer">
        
       </div>
    
</div>
<iframe width="174" height="172" name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="<%=path %>/calendar/ipopeng.html" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; left:-500px; top:0px;"></iframe>

</body>
</html>